
import Vue from 'vue'
import api from '@/api/api.js'
import utils from './utils/utils.js'

import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);

// 当前环境
const type = 'dev'


// 环境配置
const config = {
	dev: {
		baseUrl: 'http://h5.xzaiyp.top',
		agentUrl: 'http://101.35.118.225:18000'
	},
	local: {
		baseUrl: 'http://101.35.118.225:2180',
		agentUrl: 'http://127.0.0.1:18000'
	},
	prod: {
		baseUrl: 'http://101.35.118.225:2180',
		agentUrl: 'http://101.35.118.225:18000'
	}
}


// 默认配置
const defaultConfig = {
	mapKey: '',
	clientid: 'f1705eb0acde4b169e9aa7ad905c2df3',//
	appid: 'wx49a4c88028354ce0',
	aliOss: {
		url: '',
		config: {
			//桶的地址
			region: '',
			//id
			accessKeyId: '',
			//密钥
			accessKeySecret: '',
			//桶的名字
			bucket: '',
			endpoint: '',
		}
	},
}


uni.$uv.setConfig({
	// 修改$uv.config对象的属性
	config: {
		// 修改默认单位为rpx，相当于执行 uni.$uv.config.unit = 'rpx'
		unit: 'rpx'
	},
})


Vue.prototype.$config = utils.deepMergeObject(defaultConfig, config[type])

Vue.prototype.$api = api

export default Vue.prototype.$config